/**
 * @filename:NoticeServiceImpl 2022-2-24
 * @project Wonder Java前后台分离框架  1.1.0
 * Copyright(c) 2022 Wonder Co. Ltd. 
 * All right reserved. 
 */
package com.wonder.admin.service.impl;

import com.wonder.admin.domain.Notice;
import com.wonder.admin.mapper.NoticeDao;
import com.wonder.admin.service.NoticeService;
import com.wonder.admin.request.NoticeRequest;
import com.wonder.common.utils.StringUtils;
import com.wonder.common.common.AjaxMap;
import java.util.Map;
import java.util.HashMap;
import java.util.List;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**   
 * @Description:TODO(内部通知服务实现)
 *
 * @version: 1.1.0
 * @author: Wonder
 * 
 */
@Service
public class NoticeServiceImpl  extends ServiceImpl<NoticeDao, Notice> implements NoticeService  {

    /**
     * 验证内部通知信息
     * 
     * @param Notice信息
     * @return 结果
     */
    @Override
    public String validate(Notice notice){
    
    
       return "";
    }
    
    /**
	 * Description:内部通知分页返回
	 * @request:检索条件
	 * @page：分页参数
	 * @return:分页记录
	 */
	@Override 
	public IPage<Notice> selectList(NoticeRequest request, Page<Notice> page){
	    LambdaQueryWrapper<Notice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
	    
	    if (null != request.getNotice_type()) {
	       lambdaQueryWrapper.eq(Notice::getNotice_type, request.getNotice_type());
	      }               
             
	    if (null != request.getStatus()) {
	       lambdaQueryWrapper.eq(Notice::getStatus, request.getStatus());
	      }               
             
        
		lambdaQueryWrapper.orderByDesc(Notice::getNotice_id);	
		Page<Notice> selectPage = this.baseMapper.selectPage(page, lambdaQueryWrapper);

		return selectPage;
    }
        
    
	
}